[Unit]
Description=FerretDB: A truly Open Source MongoDB alternative, built on Postgres
After=syslog.target network.target

[Service]
Type=simple

User=mongod
Group=mongod

# Read in configuration file if it exists, otherwise proceed
EnvironmentFile=-/etc/default/ferretdb
WorkingDirectory=/var/lib/mongod

# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
#StandardOutput=syslog
# Start the ferretdb process
ExecStart=/usr/bin/ferretdb
KillMode=process

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30

# Do not restart the service if it crashes, we want to manually inspect database on failure
Restart=no

TimeoutStopSec=120s
LimitNOFILE=16777216
LimitNPROC=infinity
LimitCORE=infinity

# DO NOT OOM KILL FERRETDB
OOMScoreAdjust=-100

[Install]
WantedBy=multi-user.target